Synchronize to Database

The Synchronize to Database feature allows you to compare a model with an existing database or schema, states the differences between their structures, and offers synchronizing the structures in model to the target connection.

Navicat provides a step-by-step wizard for you to complete the task:

Select Synchronization Type

Sync with selected schemas

Set the synchronization to work on all objects in the selected schemas.

Sync with selected objects

Set the synchronization to work on the selected objects only.

Select Target Connection

In this step, choose a target connection from the existing connections.

Select Schemas/Objects

In this step, choose one or more schemas or objects in model to compare to the target schemas or objects. If objects in model are from existing schemas, you can select the existing schemas. Otherwise, enter a target schema name in Define the default schema name for comparison for the source model objects to compare to.

Select Synchronization Options

Note: The following options depend on the diagram database type you are chosen and sort in ascending order.

Compare auto increment value

Check this option if you want to compare the auto increment values of tables.

Compare character set

Check this option if you want to compare the character sets of tables.

Compare checks

Check this option if you want to compare checks.

Compare collation

Check this option if you want to compare the collations of tables.

Compare definers

Check this option if you want to compare the definers of views.

Compare excludes

Check this option if you want to compare excludes.

Compare foreign keys

Check this option if you want to compare table foreign keys.

Compare in case sensitive

Check this option if you want to compare table identifier with case sensitive option.

Compare indexes

Check this option if you want to compare indexes.

Compare primary keys

Check this option if you want to compare table primary keys.

Compare rules

Check this option if you want to compare rules.

Compare tables

Check this option if you want to compare tables.

Compare triggers

Check this option if you want to compare triggers.

Compare uniques

Check this option if you want to compare uniques.

Compare views

Check this option if you want to compare views.

Continue on error

Ignore errors that are encountered during the synchronization process.

SQL for objects to be changed

Check this option to include all related SQL statements if database objects will be changed in the target.

SQL for objects to be created

Check this option to include all related SQL statements if new database objects will be created in the target.

SQL for objects to be dropped

Check this option to include all related SQL statements if database objects will be dropped from the target.

View Comparison Result

The Model Objects and Database Objects views show the differences between model and database/schema objects after the comparison of their structures, providing with the detailed SQL statements shown in the Result list.

The red item represents the non-existence for the other database/schema. The blue item represents the existence for the other database/schema, but different definition detected.

All the scripts are unchecked in the Result list by default. Check the scripts you want to apply to the target.

To view the full SQL statement, move mouse cursor hovers over a statement.

Run Queries

Click the Run button to execute the selected query.